package com.itheima.vms.controller;

import com.itheima.vms.domain.dto.UserLoginDto;
import com.itheima.vms.domain.vo.UserLoginVo;
import com.itheima.vms.response.Result;
import com.itheima.vms.service.ISysUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/user")
public class UserLoginController {

    @Autowired
    private ISysUserService sysUserService;

    //登录
    @PostMapping("/login")
    public Result<UserLoginVo> login(@RequestBody UserLoginDto userLoginDto) throws Exception {
        return Result.resp(sysUserService.login(userLoginDto),"账号或密码错误!");
    }


}
